﻿using System;
using System.Threading.Tasks;

namespace Loong.Admin.Roles
{
    public class RoleAppService : AdminAppService, IRoleAppService
    {
        private readonly IRoleRepository _roleRepository;

        public RoleAppService(IRoleRepository roleRepository)
        {
            _roleRepository = roleRepository;
        }

        public async Task<RoleDto> GetAsync(Guid id)
        {
            var role = await _roleRepository.GetAsync(id);

            return ObjectMapper.Map<Role, RoleDto>(role);
        }
    }
}
